Repository navigation
feat: show session titles (agent-name/custom-title/ai-title) in sidebar, tabs and palette - #2
Merged
Merged
Conversation
…ar, tabs and palette Session list, tab labels and command palette now prefer the session title over the first user message: 1. last non-empty agent-name / custom-title entry 2. else last non-empty ai-title 3. else first user message (previous behavior) Titles are collected in the existing single streaming pass of analyzeSessionFileMetadata, so no extra file read or cache is added. Tab labels are synced on fetch and on in-place refresh (before the chunk fingerprint early return, since a rename only appends a title line). Tabs renamed by hand are flagged (labelSetByUser) and never overwritten.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Shows a session's title instead of its first user message in the sidebar, tab labels and command palette.
This reimplements Part B of upstream matt1398#129. That PR can't be applied as-is:
main.extractCustomTitle()).custom-titlelines. Current Claude Code also writes{"type":"agent-name","agentName":"..."}(session name) and{"type":"ai-title","aiTitle":"..."}(auto-generated title).Title precedence:
agent-name/custom-titleentryai-titleChanges
analyzeSessionFileMetadata(src/main/utils/jsonl.ts): picks up title entries in its existing single streaming pass and returnscustomTitle. No extra file read and no new cache.Session.customTitleis filled by bothProjectScannersession builders.getSessionTitle()(newsrc/renderer/utils/sessionTitle.ts): used bySessionItem,CommandPaletteand the tab label logic.sessionDetailSlice):SortableTab) now setsTab.labelSetByUser, and the automatic sync skips flagged tabs. Without this flag, any refresh would overwrite a hand-set tab name.Tests
test/main/utils/jsonl.test.tscovers title parsing:test/renderer/utils/sessionTitle.test.tscoversgetSessionTitle.test/renderer/store/sessionDetailSlice.test.tscovers:pnpm typecheck,pnpm lint(no errors) andpnpm test(750 tests) pass.analyzeSessionFileMetadataon real session files:add-healthy-food-plugin(agent-name) andTwo envelopes switching simulation(ai-title).